<foreach name="category" item="i">
    <a type="button" class="btn btn-default btn-primary" href="{:U('Index/Category',array('id'=>$i['id']))}">
        {$i['cname']}</a>&nbsp;&nbsp;
</foreach>